package com.net.okhttphelper.utils;

/**
 * 网络请求路径的工具类
 * @author jie
 */
public class HttpUrlUtils {

    /**
     * http请求前缀
     */
    private static final String HTTP_PREFIX = "http://";
    /**
     * https请求前缀
     */
    private static final String HTTPS_PREFIX = "https://";

    /**
     * 获取完整的url
     */
    public static String verifyUrl(String url, String baseUrl){
        if (!url.startsWith(HTTP_PREFIX) && !url.startsWith(HTTPS_PREFIX)) {
            return baseUrl + url;
        }
        return url;
    }
}
